﻿CREATE PROCEDURE [acms].[PostMenu_Delete]
	@PostVersionId int, 
	@MenuId int,
	@ConcurencyId rowversion
AS
	update PostMenu
	set Deleted = 1
	Where PostVersionId = @PostVersionId and MenuId = @MenuID and @ConcurencyId = ConcurencyId and Deleted = 0
	
	if @@RowCount = 0 begin
		if exists (Select null From PostMenu_View where PostVersionId = @PostVersionId and MenuId = @MenuID)
			return -100
		else
			return -200
	end
RETURN 0;